package com.cjm.one.model.custom.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cjm.one.model.base.BaseEntity;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 
 * @TableName custom_grade
 */
@TableName(value ="custom_grade")
@Data
public class CustomGrade extends BaseEntity implements Serializable {
    /**
     * 
     */
//    @TableId(type = IdType.AUTO)
//    private Long id;

    /**
     * 名称
     */
    private String gradeNam;

    /**
     * 图标
     */
    private String icon;

    /**
     * 折扣
     */
    private BigDecimal discount;

    /**
     * 经验要求
     */
    private Long lesson;

    /**
     * 状态，0可用 1 不可用
     */
    private Integer status;

    /**
     * 等级
     */
    private Integer grade;

    /**
     * 
     */
//    private Date createTime;
//
//    /**
//     *
//     */
//    private Date updateTime;

    /**
     * 0 可用 1不可用
     */
//    private Integer isDeleted;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;



    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        CustomGrade other = (CustomGrade) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getGradeNam() == null ? other.getGradeNam() == null : this.getGradeNam().equals(other.getGradeNam()))
            && (this.getIcon() == null ? other.getIcon() == null : this.getIcon().equals(other.getIcon()))
            && (this.getDiscount() == null ? other.getDiscount() == null : this.getDiscount().equals(other.getDiscount()))
            && (this.getLesson() == null ? other.getLesson() == null : this.getLesson().equals(other.getLesson()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getGrade() == null ? other.getGrade() == null : this.getGrade().equals(other.getGrade()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getGradeNam() == null) ? 0 : getGradeNam().hashCode());
        result = prime * result + ((getIcon() == null) ? 0 : getIcon().hashCode());
        result = prime * result + ((getDiscount() == null) ? 0 : getDiscount().hashCode());
        result = prime * result + ((getLesson() == null) ? 0 : getLesson().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getGrade() == null) ? 0 : getGrade().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(super.getId());
        sb.append(", gradeNam=").append(gradeNam);
        sb.append(", icon=").append(icon);
        sb.append(", discount=").append(discount);
        sb.append(", lesson=").append(lesson);
        sb.append(", status=").append(status);
        sb.append(", grade=").append(grade);
        sb.append(", createTime=").append(super.getCreateTime());
        sb.append(", updateTime=").append(super.getUpdateTime());
        sb.append(", isDeleted=").append(super.getIsDeleted());
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}